package auction.chapter16.cmd;

import auction.chapter16.factory.DAOFactory;

public class CommandHandlerBean implements CommandHandler {
	
	DAOFactory daoFactory=DAOFactory.instance(DAOFactory.HIBERNATE);

	public Command executeCommand(Command c) throws CommandException {
		c.execute();
		return c;
	}

	public DataAccessCommand executeCommand(DataAccessCommand c)
			throws CommandException {
		//it's the job of command handler to set any required info
		c.setDAOFactory(daoFactory);
		c.execute();
		return c;
	}

}
